<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
                "http://www.w3.org/TR/REC-html40/loose.dtd">
<html>
<head>
  <title>Description of VMT_PlotXSCont</title>
  <meta name="keywords" content="VMT_PlotXSCont">
  <meta name="description" content="Plots contours for the variable 'var' within the mean cross section given">
  <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
  <meta name="generator" content="m2html &copy; 2005 Guillaume Flandin">
  <meta name="robots" content="index, follow">
  <link type="text/css" rel="stylesheet" href="../m2html.css">
  <script type="text/javascript">
    if (top.frames.length == 0) { top.location = "../index.html"; };
  </script>
</head>
<body>
<a name="_top"></a>
<!-- menu.html trunk -->
<h1>VMT_PlotXSCont
</h1>

<h2><a name="_name"></a>PURPOSE <a href="#_top"><img alt="^" border="0" src="../up.png"></a></h2>
<div class="box"><strong>Plots contours for the variable 'var' within the mean cross section given</strong></div>

<h2><a name="_synopsis"></a>SYNOPSIS <a href="#_top"><img alt="^" border="0" src="../up.png"></a></h2>
<div class="box"><strong>function [z,A,V,zmin,zmax,log_text,fig_contour_handle] = VMT_PlotXSCont(z,A,V,var,exag,plot_english) </strong></div>

<h2><a name="_description"></a>DESCRIPTION <a href="#_top"><img alt="^" border="0" src="../up.png"></a></h2>
<div class="fragment"><pre class="comment"> Plots contours for the variable 'var' within the mean cross section given
 by the structure V. IF data is not supplied, user will be prompted to
 load data (browse to data).

 (adapted from code by J. Czuba)

 P.R. Jackson, USGS, 12-10-08 
 Last modified: F.L. Engel, USGS, 2/20/2013</pre></div>

<!-- crossreference -->
<h2><a name="_cross"></a>CROSS-REFERENCE INFORMATION <a href="#_top"><img alt="^" border="0" src="../up.png"></a></h2>
This function calls:
<ul style="list-style-image:url(../matlabicon.gif)">
<li><a href="VMT_SelectFiles.html" class="code" title="function [zPathName,zFileName,zf] = VMT_SelectFiles;">VMT_SelectFiles</a>	Prompts the user to select preprocessed transect files output by</li></ul>
This function is called by:
<ul style="list-style-image:url(../matlabicon.gif)">
<li><a href="VMT.html" class="code" title="function varargout = VMT(varargin)">VMT</a>	--- THE VELOCITY MAPPING TOOLBOX ---</li><li><a href="VMT_PlotXSContQuiver.html" class="code" title="function [z,A,V,log_text] = VMT_PlotXSContQuiver(z,A,V,var,sf,exag,qspchorz,qspcvert,secvecvar,vvelcomp,plot_english,varargin)">VMT_PlotXSContQuiver</a>	This function plots the the contour plot (mean XS) for the variable 'var'</li></ul>
<!-- crossreference -->



<h2><a name="_source"></a>SOURCE CODE <a href="#_top"><img alt="^" border="0" src="../up.png"></a></h2>
<div class="fragment"><pre>0001 <a name="_sub0" href="#_subfunctions" class="code">function [z,A,V,zmin,zmax,log_text,fig_contour_handle] = VMT_PlotXSCont(z,A,V,var,exag,plot_english)</a>
0002 <span class="comment">% Plots contours for the variable 'var' within the mean cross section given</span>
0003 <span class="comment">% by the structure V. IF data is not supplied, user will be prompted to</span>
0004 <span class="comment">% load data (browse to data).</span>
0005 <span class="comment">%</span>
0006 <span class="comment">% (adapted from code by J. Czuba)</span>
0007 <span class="comment">%</span>
0008 <span class="comment">% P.R. Jackson, USGS, 12-10-08</span>
0009 <span class="comment">% Last modified: F.L. Engel, USGS, 2/20/2013</span>
0010 
0011 
0012 
0013 <span class="comment">%disp(['Plotting Mean Cross Section Contour Plot: ' var])</span>
0014 log_text = {[<span class="string">'Plotting Mean Cross Section Contour Plot'</span>]};
0015 
0016 <span class="comment">%% User Input</span>
0017 
0018 <span class="comment">%exag=50;    %Vertical exaggeration</span>
0019 <span class="keyword">if</span> exist(<span class="string">'plot_english'</span>) == 0
0020     plot_english = 0;  <span class="comment">%plot english units (else metric)</span>
0021     disp(<span class="string">'No units specified, plotting in metric units by default'</span>)
0022 <span class="keyword">end</span>
0023 
0024 <span class="comment">%% Load the data if not supplied</span>
0025 <span class="keyword">if</span> isempty(z) &amp; isempty(A) &amp; isempty(V) 
0026     [zPathName,zFileName,zf] = <a href="VMT_SelectFiles.html" class="code" title="function [zPathName,zFileName,zf] = VMT_SelectFiles;">VMT_SelectFiles</a>;  <span class="comment">%Have the user select the preprocessed input files</span>
0027     eval([<span class="string">'load '</span> zPathName <span class="string">'\'</span> zFileName{1}]);
0028 <span class="keyword">end</span>
0029 
0030 
0031 <span class="comment">%% Plot contours</span>
0032 
0033 <span class="comment">% See if PLOT 3 exists already, if so clear the figure</span>
0034 fig_contour_handle = findobj(0,<span class="string">'name'</span>,<span class="string">'Mean Cross Section Contour'</span>);
0035 
0036 <span class="keyword">if</span> ~isempty(fig_contour_handle) &amp;&amp;  ishandle(fig_contour_handle)
0037     figure(fig_contour_handle); clf
0038 <span class="keyword">else</span>
0039     fig_contour_handle = figure(<span class="string">'name'</span>,<span class="string">'Mean Cross Section Contour'</span>); clf
0040     <span class="comment">%set(gca,'DataAspectRatio',[1 1 1],'PlotBoxAspectRatio',[1 1 1])</span>
0041 <span class="keyword">end</span>
0042 
0043 <span class="comment">% Turn off the menu bar, and keep only specified tools</span>
0044 disableMenuBar(fig_contour_handle)
0045 
0046 clvls = 60;
0047 
0048 <span class="comment">%Find the direction of primary discharge (flip if necessary)</span>
0049 binwidth  = diff(V.mcsDist,1,2);
0050 binwidth  = horzcat(binwidth(:,1), binwidth);
0051 binheight = diff(V.mcsDepth,1,1);
0052 binheight = vertcat(binheight, binheight(1,:));
0053 flux = nansum(nansum(V.u./100.*binwidth.*binheight)); <span class="comment">%Not a true measured discharge because of averaging, smoothing, edges, etc. but close</span>
0054 
0055 <span class="comment">% if zerosecq</span>
0056 <span class="comment">%     pdmin = nanmin(nanmin(V.vp));</span>
0057 <span class="comment">%     pdmax = nanmax(nanmax(V.vp));</span>
0058 <span class="comment">% else</span>
0059 <span class="comment">%     pdmin = nanmin(nanmin(V.u));</span>
0060 <span class="comment">%     pdmax = nanmax(nanmax(V.u));</span>
0061 <span class="comment">% end</span>
0062 <span class="keyword">if</span> flux &lt; 0; <span class="comment">%abs(pdmin) &gt; abs(pdmax)</span>
0063     flipxs = 1;
0064 <span class="keyword">else</span>
0065     flipxs = 0;
0066 <span class="keyword">end</span>
0067 
0068 <span class="keyword">if</span> flipxs 
0069     <span class="comment">%disp(['Streamwise Flow Direction (Normal to mean XS; deg) = ' num2str(V.phi - 180)])</span>
0070     <span class="comment">%disp(['Primary Flow Direction (deg) = ' num2str(V.phisp - 180)])</span>
0071     msg_str_1 = {[<span class="string">'   Streamwise Flow Direction (Normal to mean XS; deg) = '</span> num2str(V.phi - 180)];<span class="keyword">...</span>
0072         [<span class="string">'   Primary Flow Direction (deg) = '</span> num2str(V.phisp - 180)]};
0073 <span class="keyword">else</span>
0074     <span class="comment">%disp(['Streamwise Flow Direction (Normal to mean XS; deg) = ' num2str(V.phi)])</span>
0075     <span class="comment">%disp(['Primary Flow Direction (deg) = ' num2str(V.phisp)])</span>
0076     msg_str_1 = {[<span class="string">'   Streamwise Flow Direction (Normal to mean XS; deg) = '</span> num2str(V.phi)];<span class="keyword">...</span>
0077         [<span class="string">'   Primary Flow Direction (deg) = '</span> num2str(V.phisp)]};
0078 <span class="keyword">end</span>
0079 <span class="comment">%disp(['Deviation from Streamwise Direction (deg) = ' num2str(V.alphasp)])</span>
0080 <span class="comment">%disp(['Horizontal Grid Node Spacing (m) = ' num2str(A(1).hgns)])</span>
0081 
0082 <span class="comment">%Display in message box for compiled version</span>
0083 msg_string = {[<span class="string">'   Deviation from Streamwise Direction (deg) = '</span> num2str(V.alphasp)];<span class="keyword">...</span>
0084     <span class="keyword">...</span><span class="comment">['   Horizontal Grid Node Spacing (m) = ' num2str(A(1).hgns)]...</span>
0085     };
0086 <span class="comment">%msgbox([msg_str_1, msg_string],'VMT Cross Section Characteristics','help','replace');</span>
0087 log_text = vertcat(log_text,msg_str_1,msg_string);
0088 
0089 <span class="keyword">switch</span> var
0090     <span class="keyword">case</span>{<span class="string">'streamwise'</span>}  <span class="comment">%Plots the streamwise velocity</span>
0091         <span class="keyword">if</span> flipxs
0092             wtp=[<span class="string">'-V.uSmooth'</span>];
0093             zmin=floor(nanmin(nanmin(-V.uSmooth)));
0094             zmax=ceil(nanmax(nanmax(-V.uSmooth)));
0095         <span class="keyword">else</span>
0096             wtp=[<span class="string">'V.uSmooth'</span>];
0097             zmin=floor(nanmin(nanmin(V.uSmooth)));
0098             zmax=ceil(nanmax(nanmax(V.uSmooth)));
0099         <span class="keyword">end</span>
0100         zinc = (zmax - zmin) / clvls;
0101         zlevs = zmin:zinc:zmax;     
0102     <span class="keyword">case</span>{<span class="string">'transverse'</span>} <span class="comment">%Plots the transverse velocity</span>
0103         wtp=[<span class="string">'V.vSmooth'</span>];
0104         zmax=ceil(max(abs(nanmin(nanmin(V.vSmooth))),abs(nanmax(nanmax(V.vSmooth)))));
0105         zmin=-zmax;
0106         zinc = (zmax - zmin) / clvls;
0107         zlevs = zmin:zinc:zmax;
0108     <span class="keyword">case</span>{<span class="string">'vertical'</span>} <span class="comment">%Plots the vertical velocity</span>
0109         wtp=[<span class="string">'V.wSmooth'</span>];
0110         zmax=ceil(max(abs(nanmin(nanmin(V.wSmooth))),abs(nanmax(nanmax(V.wSmooth)))));
0111         zmin=-zmax;
0112         zinc = (zmax - zmin) / clvls;
0113         zlevs = zmin:zinc:zmax;
0114     <span class="keyword">case</span>{<span class="string">'mag'</span>} <span class="comment">%Plots the velocity magnitude</span>
0115         wtp=[<span class="string">'V.mcsMagSmooth'</span>];
0116         zmin=floor(nanmin(nanmin(V.mcsMagSmooth)));
0117         zmax=ceil(nanmax(nanmax(V.mcsMagSmooth)));
0118         zinc = (zmax - zmin) / clvls;
0119         zlevs = zmin:zinc:zmax;
0120     <span class="keyword">case</span>{<span class="string">'east'</span>} <span class="comment">%Plots the east velocity</span>
0121         wtp=[<span class="string">'V.mcsEastSmooth'</span>];
0122         zmin=floor(nanmin(nanmin(V.mcsEastSmooth)));
0123         zmax=ceil(nanmax(nanmax(V.mcsEastSmooth)));
0124         zinc = (zmax - zmin) / clvls;
0125         zlevs = zmin:zinc:zmax;
0126     <span class="keyword">case</span>{<span class="string">'error'</span>} <span class="comment">%Plots the error velocity</span>
0127         wtp=[<span class="string">'V.mcsErrorSmooth'</span>];
0128         zmin=floor(nanmin(nanmin(V.mcsErrorSmooth)));
0129         zmax=ceil(nanmax(nanmax(V.mcsErrorSmooth)));
0130         zinc = (zmax - zmin) / clvls;
0131         zlevs = zmin:zinc:zmax;
0132     <span class="keyword">case</span>{<span class="string">'north'</span>} <span class="comment">%Plots the north velocity</span>
0133         wtp=[<span class="string">'V.mcsNorthSmooth'</span>];
0134         zmin=floor(nanmin(nanmin(V.mcsNorthSmooth)));
0135         zmax=ceil(nanmax(nanmax(V.mcsNorthSmooth)));
0136         zinc = (zmax - zmin) / clvls;
0137         zlevs = zmin:zinc:zmax;
0138     <span class="keyword">case</span>{<span class="string">'primary_zsd'</span>}  <span class="comment">%Plots the primary velocity with zero secondary discharge definition</span>
0139         <span class="keyword">if</span> flipxs
0140             wtp=[<span class="string">'-V.vpSmooth'</span>];
0141             zmin=floor(nanmin(nanmin(-V.vpSmooth)));
0142             zmax=ceil(nanmax(nanmax(-V.vpSmooth)));
0143         <span class="keyword">else</span>
0144             wtp=[<span class="string">'V.vpSmooth'</span>];
0145             zmin=floor(nanmin(nanmin(V.vpSmooth)));
0146             zmax=ceil(nanmax(nanmax(V.vpSmooth)));
0147         <span class="keyword">end</span>
0148         zinc = (zmax - zmin) / clvls;
0149         zlevs = zmin:zinc:zmax;                  
0150     <span class="keyword">case</span>{<span class="string">'secondary_zsd'</span>} <span class="comment">%Plots the secondary velocity with zero secondary discharge definition</span>
0151         wtp=[<span class="string">'V.vsSmooth'</span>];
0152         zmax=ceil(max(abs(nanmin(nanmin(V.vsSmooth))),abs(nanmax(nanmax(V.vsSmooth)))));
0153         zmin=-zmax;
0154         zinc = (zmax - zmin) / clvls;
0155         zlevs = zmin:zinc:zmax;
0156     <span class="keyword">case</span>{<span class="string">'primary_roz'</span>}  <span class="comment">%Plots the primary velocity with Rozovskii definition</span>
0157 <span class="comment">%         wtp=['V.Roz.upSmooth'];</span>
0158 <span class="comment">%         zmin=floor(nanmin(nanmin(V.Roz.upSmooth)));</span>
0159 <span class="comment">%         zmax=ceil(nanmax(nanmax(V.Roz.upSmooth)));</span>
0160         
0161         <span class="keyword">if</span> flipxs
0162             wtp=[<span class="string">'-V.Roz.upSmooth'</span>];  
0163             zmin=floor(nanmin(nanmin(-V.Roz.upSmooth)));
0164             zmax=ceil(nanmax(nanmax(-V.Roz.upSmooth)));
0165         <span class="keyword">else</span>
0166             wtp=[<span class="string">'V.Roz.upSmooth'</span>];
0167             zmin=floor(nanmin(nanmin(V.Roz.upSmooth)));
0168             zmax=ceil(nanmax(nanmax(V.Roz.upSmooth)));
0169         <span class="keyword">end</span>
0170         zinc = (zmax - zmin) / clvls;
0171         zlevs = zmin:zinc:zmax;                
0172     <span class="keyword">case</span>{<span class="string">'secondary_roz'</span>} <span class="comment">%Plots the secondary velocity with Rozovskii definition</span>
0173         wtp=[<span class="string">'V.Roz.usSmooth'</span>];
0174         zmax=ceil(max(abs(nanmin(nanmin(V.Roz.usSmooth))),abs(nanmax(nanmax(V.Roz.usSmooth)))));
0175         zmin=-zmax;
0176         zinc = (zmax - zmin) / clvls;
0177         zlevs = zmin:zinc:zmax;
0178     <span class="keyword">case</span>{<span class="string">'primary_roz_x'</span>}  <span class="comment">%Plots the primary velocity with Rozovskii definition (downstream component)</span>
0179 <span class="comment">%         wtp=['V.Roz.upxSmooth'];</span>
0180 <span class="comment">%         zmin=floor(nanmin(nanmin(V.Roz.upxSmooth)));</span>
0181 <span class="comment">%         zmax=ceil(nanmax(nanmax(V.Roz.upxSmooth)));</span>
0182       
0183         <span class="keyword">if</span> flipxs
0184             wtp=[<span class="string">'-V.Roz.upxSmooth'</span>];  
0185             zmin=floor(nanmin(nanmin(-V.Roz.upxSmooth)));
0186             zmax=ceil(nanmax(nanmax(-V.Roz.upxSmooth)));
0187         <span class="keyword">else</span>
0188             wtp=[<span class="string">'V.Roz.upxSmooth'</span>];
0189             zmin=floor(nanmin(nanmin(V.Roz.upxSmooth)));
0190             zmax=ceil(nanmax(nanmax(V.Roz.upxSmooth)));
0191         <span class="keyword">end</span>
0192         zinc = (zmax - zmin) / clvls;
0193         zlevs = zmin:zinc:zmax; 
0194     <span class="keyword">case</span>{<span class="string">'primary_roz_y'</span>}  <span class="comment">%Plots the primary velocity with Rozovskii definition (cross-stream component)</span>
0195         wtp=[<span class="string">'V.Roz.upySmooth'</span>];
0196         zmin=floor(nanmin(nanmin(V.Roz.upySmooth)));
0197         zmax=ceil(nanmax(nanmax(V.Roz.upySmooth)));
0198             
0199 <span class="comment">%         if flipxs</span>
0200 <span class="comment">%             wtp=['-V.Roz.upySmooth'];</span>
0201 <span class="comment">%             zmin=floor(nanmin(nanmin(-V.Roz.upySmooth)));</span>
0202 <span class="comment">%             zmax=ceil(nanmax(nanmax(-V.Roz.upySmooth)));</span>
0203 <span class="comment">%         else</span>
0204 <span class="comment">%             wtp=['V.Roz.upySmooth'];</span>
0205 <span class="comment">%             zmin=floor(nanmin(nanmin(V.Roz.upySmooth)));</span>
0206 <span class="comment">%             zmax=ceil(nanmax(nanmax(V.Roz.upySmooth)));</span>
0207 <span class="comment">%         end</span>
0208         zinc = (zmax - zmin) / clvls;
0209         zlevs = zmin:zinc:zmax;
0210     <span class="keyword">case</span>{<span class="string">'secondary_roz_x'</span>} <span class="comment">%Plots the secondary velocity with Rozovskii definition (downstream component)</span>
0211         wtp=[<span class="string">'V.Roz.usxSmooth'</span>];
0212         zmax=ceil(max(abs(nanmin(nanmin(V.Roz.usxSmooth))),abs(nanmax(nanmax(V.Roz.usxSmooth)))));
0213         zmin=-zmax;
0214         zinc = (zmax - zmin) / clvls;
0215         zlevs = zmin:zinc:zmax;
0216     <span class="keyword">case</span>{<span class="string">'secondary_roz_y'</span>} <span class="comment">%Plots the secondary velocity with Rozovskii definition (cross-stream component)</span>
0217         wtp=[<span class="string">'V.Roz.usySmooth'</span>];
0218         zmax=ceil(max(abs(nanmin(nanmin(V.Roz.usySmooth))),abs(nanmax(nanmax(V.Roz.usySmooth)))));
0219         zmin=-zmax;
0220         zinc = (zmax - zmin) / clvls;
0221         zlevs = zmin:zinc:zmax;        
0222     <span class="keyword">case</span>{<span class="string">'backscatter'</span>} <span class="comment">%Plots the backscatter</span>
0223         wtp=[<span class="string">'V.mcsBackSmooth'</span>];
0224         zmin=floor(nanmin(nanmin(V.mcsBackSmooth)));
0225         zmax=ceil(nanmax(nanmax(V.mcsBackSmooth)));
0226         zinc = (zmax - zmin) / clvls;
0227         zlevs = zmin:zinc:zmax;
0228     <span class="keyword">case</span>{<span class="string">'flowangle'</span>} <span class="comment">%Plots the flow direction (N = 0.0 deg)</span>
0229         wtp=[<span class="string">'V.mcsDirSmooth'</span>];
0230         zmin=floor(nanmin(nanmin(V.mcsDirSmooth)));
0231         zmax=ceil(nanmax(nanmax(V.mcsDirSmooth)));
0232         zinc = (zmax - zmin) / clvls;
0233         zlevs = zmin:zinc:zmax;
0234     <span class="keyword">case</span>{<span class="string">'vorticity_vw'</span>} 
0235         wtp=[<span class="string">'V.vorticity_vw'</span>];
0236         zmin=floor(nanmin(V.vorticity_vw(:)));
0237         zmax=ceil(nanmax(V.vorticity_vw(:)));
0238         zinc = (zmax - zmin) / clvls;
0239         zlevs = zmin:zinc:zmax;
0240     <span class="keyword">case</span>{<span class="string">'vorticity_zsd'</span>}
0241         wtp=[<span class="string">'V.vorticity_zsd'</span>];
0242         zmin=floor(nanmin(V.vorticity_zsd(:)));
0243         zmax=ceil(nanmax(V.vorticity_zsd(:)));
0244         zinc = (zmax - zmin) / clvls;
0245         zlevs = zmin:zinc:zmax;
0246     <span class="keyword">case</span>{<span class="string">'vorticity_roz'</span>} 
0247         wtp=[<span class="string">'V.vorticity_roz'</span>];
0248         zmin = floor(nanmin(V.vorticity_roz(:)));
0249         zmax = ceil(nanmax(V.vorticity_roz(:)));
0250         zinc = (zmax - zmin) / clvls;
0251         zlevs = zmin:zinc:zmax;
0252 
0253 <span class="comment">%     case{'dirdevp'} %Plots the directional deviation from the primary velocity</span>
0254 <span class="comment">%         wtp=['V.mcsDirDevp'];</span>
0255 <span class="comment">%         %zmax=ceil(max(abs(nanmin(nanmin(V.mcsDirDevp))),abs(nanmax(nanmax(V.mcsDirDevp)))));</span>
0256 <span class="comment">%         %zmin=-zmax;</span>
0257 <span class="comment">%         zmin=floor(nanmin(nanmin(V.mcsDirDevp)));</span>
0258 <span class="comment">%         zmax=ceil(nanmax(nanmax(V.mcsDirDevp)));</span>
0259 <span class="comment">%         zinc = (zmax - zmin) / clvls;</span>
0260 <span class="comment">%         zlevs = zmin:zinc:zmax;</span>
0261 <span class="keyword">end</span>
0262 
0263 
0264 figure(fig_contour_handle); hold all
0265 <span class="keyword">if</span> plot_english
0266     convfact = 0.03281; <span class="comment">%cm/s to ft/s</span>
0267     <span class="keyword">switch</span> var
0268         <span class="keyword">case</span>{<span class="string">'backscatter'</span>}
0269             convfact = 1.0; 
0270         <span class="keyword">case</span>{<span class="string">'flowangle'</span>}
0271             convfact = 1.0;
0272     <span class="keyword">end</span>
0273     contour_handle = pcolor(V.mcsDist*3.281,V.mcsDepth*3.281,eval(wtp)*convfact); hold on
0274     shading interp
0275     <span class="comment">%[~,contour_handle] = contour(V.mcsDist*3.281,V.mcsDepth*3.281,eval(wtp)*convfact,zlevs*convfact,'Fill','on','Linestyle','none'); hold on  %wtp(1,:)</span>
0276     bed_handle         = plot(V.mcsDist(1,:)*3.281,V.mcsBed*3.281,<span class="string">'w'</span>, <span class="string">'LineWidth'</span>,2); hold on
0277 <span class="keyword">else</span>
0278     contour_handle = pcolor(V.mcsDist,V.mcsDepth,eval(wtp)); hold on
0279     shading interp
0280     <span class="comment">%[~,contour_handle] = contour(V.mcsDist,V.mcsDepth,eval(wtp),zlevs,'Fill','on','Linestyle','none'); hold on  %wtp(1,:)</span>
0281     bed_handle         = plot(V.mcsDist(1,:),V.mcsBed,<span class="string">'w'</span>, <span class="string">'LineWidth'</span>,2); hold on
0282 <span class="keyword">end</span>
0283 
0284 
0285 
0286 <span class="comment">%Plot the grid node for a check</span>
0287 <span class="keyword">if</span> 0
0288     plot(V.mcsDist,V.mcsDepth,<span class="string">'k.'</span>,<span class="string">'MarkerSize'</span>,3); hold on
0289     [goodcellsx,goodcellsy] = find(isnan(eval(wtp)) == 0);
0290     plot(V.mcsDist(1,goodcellsy),V.mcsDepth(goodcellsx,1),<span class="string">'w.'</span>,<span class="string">'MarkerSize'</span>,3); hold on
0291 <span class="keyword">end</span>
0292 
0293 <span class="keyword">if</span> plot_english
0294     unitlabel = <span class="string">'(ft/s)'</span>;
0295 <span class="keyword">else</span>
0296     unitlabel = <span class="string">'(cm/s)'</span>;
0297 <span class="keyword">end</span>
0298 
0299 <span class="keyword">switch</span> var
0300     <span class="keyword">case</span>{<span class="string">'streamwise'</span>}
0301         title_handle = title([<span class="string">'Streamwise Velocity '</span> unitlabel]);
0302     <span class="keyword">case</span>{<span class="string">'transverse'</span>}
0303         title_handle = title([<span class="string">'Transverse Velocity '</span> unitlabel]);
0304     <span class="keyword">case</span>{<span class="string">'vertical'</span>}
0305         title_handle = title([<span class="string">'Vertical Velocity '</span> unitlabel]);
0306     <span class="keyword">case</span>{<span class="string">'mag'</span>}
0307         title_handle = title([<span class="string">'Velocity Magnitude (Streamwise and Transverse) '</span> unitlabel]);
0308     <span class="keyword">case</span>{<span class="string">'east'</span>}
0309         title_handle = title([<span class="string">'East Velocity '</span> unitlabel]);
0310     <span class="keyword">case</span>{<span class="string">'north'</span>}
0311         title_handle = title([<span class="string">'North Velocity '</span> unitlabel]);
0312     <span class="keyword">case</span>{<span class="string">'error'</span>}
0313         title_handle = title([<span class="string">'Error Velocity '</span> unitlabel]);
0314     <span class="keyword">case</span>{<span class="string">'primary_zsd'</span>}
0315         title_handle = title([<span class="string">'Primary Velocity (Zero Secondary Discharge Definition) '</span> unitlabel]);
0316     <span class="keyword">case</span>{<span class="string">'secondary_zsd'</span>}
0317         title_handle = title([<span class="string">'Secondary Velocity (Zero Secondary Discharge Definition) '</span> unitlabel]);
0318     <span class="keyword">case</span>{<span class="string">'primary_roz'</span>}
0319         title_handle = title([<span class="string">'Primary Velocity (Rozovskii Definition) '</span> unitlabel]);
0320     <span class="keyword">case</span>{<span class="string">'secondary_roz'</span>}
0321         title_handle = title([<span class="string">'Secondary Velocity (Rozovskii Definition) '</span> unitlabel]); 
0322     <span class="keyword">case</span>{<span class="string">'primary_roz_x'</span>}
0323         title_handle = title([<span class="string">'Primary Velocity (Rozovskii Definition; Downstream Component) '</span> unitlabel]);    
0324     <span class="keyword">case</span>{<span class="string">'primary_roz_y'</span>}
0325         title_handle = title([<span class="string">'Primary Velocity (Rozovskii Definition; Cross-Stream Component) '</span> unitlabel]);        
0326     <span class="keyword">case</span>{<span class="string">'secondary_roz_x'</span>}
0327         title_handle = title([<span class="string">'Secondary Velocity (Rozovskii Definition; Downstream Component) '</span> unitlabel]);        
0328     <span class="keyword">case</span>{<span class="string">'secondary_roz_y'</span>}
0329         title_handle = title([<span class="string">'Secondary Velocity (Rozovskii Definition; Cross-Stream Component) '</span> unitlabel]);        
0330     <span class="keyword">case</span>{<span class="string">'backscatter'</span>}
0331         title_handle = title(<span class="string">'Backscatter Intensity (dB)'</span>);
0332     <span class="keyword">case</span>{<span class="string">'flowangle'</span>}
0333         title_handle = title(<span class="string">'Flow Direction (deg)'</span>);
0334     <span class="keyword">case</span>{<span class="string">'vorticity_vw'</span>}
0335         title_handle = title(<span class="string">'Streamwise Vorticity'</span>);
0336     <span class="keyword">case</span>{<span class="string">'vorticity_zsd'</span>}
0337         title_handle = title(<span class="string">'Streamwise Vorticity (Zero Secondary Discharge Definition)'</span>);
0338     <span class="keyword">case</span>{<span class="string">'vorticity_roz'</span>}
0339         title_handle = title(<span class="string">'Streamwise Vorticity (Rozovskii Definition)'</span>);
0340 <span class="comment">%     case{'dirdevp'}</span>
0341 <span class="comment">%         title('Deviation from Primary Flow Direction (deg)')</span>
0342 <span class="keyword">end</span>
0343 colorbar_handle = colorbar; hold all
0344 
0345 <span class="keyword">if</span> plot_english
0346     caxis([zmin*convfact zmax*convfact])
0347     xlim([nanmin(nanmin(V.mcsDist*3.281)) nanmax(nanmax(V.mcsDist*3.281))])
0348     ylim([0 max(V.mcsBed*3.281)])
0349     set(gca,<span class="string">'YDir'</span>,<span class="string">'reverse'</span>)
0350     <span class="keyword">if</span> flipxs
0351         set(gca,<span class="string">'XDir'</span>,<span class="string">'reverse'</span>)
0352     <span class="keyword">end</span>
0353     ylabel_handle = ylabel(<span class="string">'Depth (ft)'</span>);
0354     xlabel_handle = xlabel(<span class="string">'Distance (ft)'</span>);
0355 <span class="keyword">else</span>
0356     caxis([zmin zmax])
0357     xlim([nanmin(nanmin(V.mcsDist)) nanmax(nanmax(V.mcsDist))])
0358     ylim([0 max(V.mcsBed)])
0359     set(gca,<span class="string">'YDir'</span>,<span class="string">'reverse'</span>)
0360     <span class="keyword">if</span> flipxs
0361         set(gca,<span class="string">'XDir'</span>,<span class="string">'reverse'</span>)
0362     <span class="keyword">end</span>
0363     ylabel_handle = ylabel(<span class="string">'Depth (m)'</span>);
0364     xlabel_handle = xlabel(<span class="string">'Distance (m)'</span>);
0365 <span class="keyword">end</span>
0366 
0367 <span class="keyword">if</span> strcmp(var,<span class="string">'vorticity_vw'</span>)||strcmp(var,<span class="string">'vorticity_zsd'</span>)||strcmp(var,<span class="string">'vorticity_roz'</span>)
0368     rng = zmax - zmin;
0369     cmr = [linspace(0,1,25)'];
0370     cmr = [cmr; linspace(1,1,25)'];
0371     cmg = [linspace(0,1,25)'];
0372     cmg = [cmg; linspace(1,0,25)'];
0373     cmb = [linspace(1,1,25)'];
0374     cmb = [cmb; linspace(1,0,25)'];
0375     figure(3)
0376     colormap([cmr cmg cmb])
0377     caxis([-rng/2 rng/2])
0378 <span class="keyword">else</span>
0379     colormap jet
0380 <span class="keyword">end</span>
0381 
0382 <span class="comment">% Tag the elements in the figure</span>
0383 set(contour_handle,                 <span class="string">'Tag'</span>,<span class="string">'ContouredVelocities'</span>)
0384 set(bed_handle,                     <span class="string">'Tag'</span>,<span class="string">'PlotBedElevation'</span>)
0385 set(colorbar_handle,                <span class="string">'Tag'</span>,<span class="string">'ColorBar'</span>)
0386 set(title_handle,                   <span class="string">'Tag'</span>,<span class="string">'ContourPlotTitle'</span>)
0387 set(ylabel_handle,                  <span class="string">'Tag'</span>,<span class="string">'yLabelText'</span>)
0388 set(xlabel_handle,                  <span class="string">'Tag'</span>,<span class="string">'xLabelText'</span>)
0389 
0390 <span class="comment">% Adjust the plot</span>
0391 set(gca,<span class="keyword">...</span>
0392     <span class="string">'DataAspectRatio'</span>,   [exag 1 1],<span class="keyword">...</span>
0393     <span class="string">'PlotBoxAspectRatio'</span>,[exag 1 1]<span class="keyword">...</span>
0394     <span class="keyword">...</span><span class="comment">'FontSize',          14)</span>
0395     )
0396 <span class="comment">% set(get(gca,'Title'),   'FontSize',14,'Color','w')</span>
0397 <span class="comment">% set(get(gca,'xlabel'),  'FontSize',14,'Color','w')</span>
0398 <span class="comment">% set(get(gca,'ylabel'),  'FontSize',14,'Color','w')</span>
0399 <span class="comment">% set(gca,...</span>
0400 <span class="comment">%     'XColor','w',...</span>
0401 <span class="comment">%     'YColor','w',...</span>
0402 <span class="comment">%     'ZColor','w',...</span>
0403 <span class="comment">%     'Color',[0.3 0.3 0.3])</span>
0404 <span class="comment">% set(gcf,...</span>
0405 <span class="comment">%     'InvertHardCopy','off',...</span>
0406 <span class="comment">%     'Color','k')</span>
0407 <span class="comment">%figure('Name','Cross Section','NumberTitle','off')</span>
0408 <span class="comment">% scrsz = get(0,'ScreenSize');</span>
0409 <span class="comment">% figure('OuterPosition',[1 scrsz(4) scrsz(3) scrsz(4)])</span>
0410 
0411 <span class="comment">%figure(5); clf; compass(V.mcsEast,V.mcsNorth)</span>
0412</pre></div>
<hr><address>Generated on Wed 04-Jun-2014 14:21:02 by <strong><a href="http://www.artefact.tk/software/matlab/m2html/" target="_parent">m2html</a></strong> &copy; 2005</address>
</body>
</html>